<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <meta http-equiv="Cache-Control" content="no-transform">
  <meta http-equiv="Cache-Control" content="no-siteapp">
  <meta name="baidu-site-verification" content="code-Qk3hgFvTdc">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gitee.com","root":"/","scheme":"Gemini","version":"7.8.0","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":true},"copycode":{"enable":true,"show_result":true,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":true,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"disqus","storage":true,"lazyload":false,"nav":{"disqus":{"text":"Load Disqus","order":-1}}},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="Arthas排查jvm相关问题的利器背景：一次线上问题的综合排查排查，两个相同的系统的某个模块，数据量更少的系统查询更慢。先说下整体思路：  查看系统整理负载，网络有100左右毫秒的延迟，看起来影响不大">
<meta property="og:type" content="article">
<meta property="og:title" content="Arthas排查jvm相关问题的利器">
<meta property="og:url" content="https://gitee.com/feege/feege.git/2021/08/23/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/index.html">
<meta property="og:site_name" content="云记">
<meta property="og:description" content="Arthas排查jvm相关问题的利器背景：一次线上问题的综合排查排查，两个相同的系统的某个模块，数据量更少的系统查询更慢。先说下整体思路：  查看系统整理负载，网络有100左右毫秒的延迟，看起来影响不大">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas1.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas2.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas3.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas4.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas5.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas6.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas13.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas7.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas8.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas9.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas10.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas11.png">
<meta property="og:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas12.png">
<meta property="article:published_time" content="2021-08-23T06:46:19.622Z">
<meta property="article:modified_time" content="2021-08-23T06:52:46.915Z">
<meta property="article:author" content="云记">
<meta property="article:tag" content="Java,面试,offer,技术,微服务,分布式,中间件,数据库,bat">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas1.png">

<link rel="canonical" href="https://gitee.com/feege/feege.git/2021/08/23/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Arthas排查jvm相关问题的利器 | 云记</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">云记</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">云记</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">5</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">12</span></a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gitee.com/feege/feege.git/2021/08/23/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="云记">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="云记">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Arthas排查jvm相关问题的利器
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-08-23 14:46:19" itemprop="dateCreated datePublished" datetime="2021-08-23T14:46:19+08:00">2021-08-23</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7/" itemprop="url" rel="index"><span itemprop="name">开发工具</span></a>
                </span>
            </span>

          
            <span id="/2021/08/23/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/" class="post-meta-item leancloud_visitors" data-flag-title="Arthas排查jvm相关问题的利器" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/08/23/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/08/23/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>4.9k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>4 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="Arthas排查jvm相关问题的利器"><a href="#Arthas排查jvm相关问题的利器" class="headerlink" title="Arthas排查jvm相关问题的利器"></a>Arthas排查jvm相关问题的利器</h1><h1 id="背景："><a href="#背景：" class="headerlink" title="背景："></a>背景：</h1><p>一次线上问题的综合排查排查，两个相同的系统的某个模块，数据量更少的系统查询更慢。<br>先说下整体思路：</p>
<ol>
<li><p>查看系统整理负载，网络有100左右毫秒的延迟，看起来影响不大</p>
<span id="more"></span></li>
<li><p>查看正序运行整体情况，一次查询会经历3次FGC，有问题，解决后虽然会快一些但是还是有点慢</p>
</li>
<li><p>跟踪调用栈，发现有点在获查询结果的时候特别慢</p>
</li>
<li><p>排查是否有mysql慢查询(定义为1秒以上的查询)，结果是没有</p>
</li>
<li><p>通过arthas发现调用了20多次查询，每次网络延迟100ms，加起来就有2s了，定位出问题。</p>
</li>
</ol>
<p>这样看起来arthas真的很强大，它不仅仅能处理上述问题，还能….</p>
<ul>
<li>这个类从哪个 jar 包加载的？为什么会报各种类相关的 Exception？</li>
<li>我改的代码为什么没有执行到？难道是我没 commit？分支搞错了？</li>
<li>遇到问题无法在线上 debug，难道只能通过加日志再重新发布吗？</li>
<li>线上遇到某个用户的数据处理有问题，但线上同样无法 debug，线下无法重现！</li>
<li>是否有一个全局视角来查看系统的运行状况？</li>
<li>有什么办法可以监控到JVM的实时运行状态？</li>
<li>代码出现异常，怎么能获取请求参数和返回值。</li>
</ul>
<h1 id="Arthas到底是什么"><a href="#Arthas到底是什么" class="headerlink" title="Arthas到底是什么"></a>Arthas到底是什么</h1><p>Arthas 是Alibaba开源的Java诊断工具，采用命令行交互模式，提供了丰富的功能，是排查jvm相关问题的利器。<br>在逛github时，发现了这款利器，深入了解之后，简直惊为天人。下面先列举一下它能做的一些事情：</p>
<ul>
<li>提供性能看板，包括线程、cpu、内存等信息，并且会定时的刷新。</li>
<li>根据各种条件查看线程快照。比如找出cpu占用率最高的n个线程等</li>
<li>输出jvm的各种信息，如gc算法、jdk版本、ClassPath等</li>
<li>查看/设置sysprop和sysenv</li>
<li>查看某个类的静态属性，也可以通过ognl语法执行一些语句</li>
<li>查看已加载的类的详细信息，比如这个类从哪个jar包加载的。也可以查看类的方法的信息</li>
<li>dump某个类的字节码到指定目录</li>
<li>直接反编译指定的类</li>
<li>查看类加载器的一些信息</li>
<li>可以让jvm重新加载某个类</li>
<li>监控方法的执行，同时可以获取到执行的入参、出参以及抛出的异常</li>
<li>追踪方法执行的调用栈，以及各个方法的调用时间</li>
</ul>
<h1 id="Arthas运行原理"><a href="#Arthas运行原理" class="headerlink" title="Arthas运行原理"></a>Arthas运行原理</h1><p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas1.png" alt="image"></p>
<h1 id="Arthas命令列表"><a href="#Arthas命令列表" class="headerlink" title="Arthas命令列表"></a>Arthas命令列表</h1><p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas2.png" alt="image"></p>
<h1 id="athas的各个命令"><a href="#athas的各个命令" class="headerlink" title="athas的各个命令"></a>athas的各个命令</h1><h2 id="sc-和-sm"><a href="#sc-和-sm" class="headerlink" title="sc 和 sm"></a>sc 和 sm</h2><ul>
<li>通过sc可以查看已加载类的相关信息，比如该类是从哪个jar包加载的，被哪个类加载器加载的，以及是否是接口等等。</li>
<li>sm查看已加载类的方法详情。</li>
</ul>
<h2 id="dashboard"><a href="#dashboard" class="headerlink" title="dashboard"></a>dashboard</h2><p>进入当前系统的实时数据面板，按 ctrl+c 退出。这个面板会实时刷新，其中包括线程信息、内存信息、gc信息、还有一些运行时的数据。<br>另外，当运行在Ali-tomcat时，会显示当前tomcat的实时信息，如HTTP请求的qps, rt, 错误数, 线程池信息等等。</p>
<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas3.png" alt="image"></p>
<h2 id="thread"><a href="#thread" class="headerlink" title="thread"></a>thread</h2><p>通过thread命令可以查看当前jvm进程的线程详情。可以查看线程的cpu使用时间占比，通过指定各种参数可以找出最忙的几个线程，以及阻塞其他线程的线程。具体如何使用这里不多做介绍，大家可以去看arthas的官方文档。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">当前最忙的前N个线程并打印堆栈</span><br><span class="line">thread -i 5000 </span><br><span class="line">thread -i 5000 </span><br></pre></td></tr></table></figure>

<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas4.png" alt="image"></p>
<h2 id="jvm"><a href="#jvm" class="headerlink" title="jvm"></a>jvm</h2><p>通过jvm命令直接输出当前jvm的各种信息。</p>
<h2 id="getstatic"><a href="#getstatic" class="headerlink" title="getstatic"></a>getstatic</h2><p>通过getstatic命令可以方便的查看类的静态属性。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">getstatic demo.MahtGame random</span><br></pre></td></tr></table></figure>

<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas5.png" alt="image"></p>
<h2 id="sysprop和sysenv"><a href="#sysprop和sysenv" class="headerlink" title="sysprop和sysenv"></a>sysprop和sysenv</h2><ul>
<li>通过sysprop可以查看所有的系统变量，也可以设置某个系统变量。</li>
<li>同理，通过sysenv可以查看所有的操作系统环境变量，也可以查看设置某个环境变量。</li>
</ul>
<h2 id="ognl"><a href="#ognl" class="headerlink" title="ognl"></a>ognl</h2><p>执行ognl表达式，可执行任意代码</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Ognl @demo.MathGame@random</span><br></pre></td></tr></table></figure>

<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas6.png" alt="image"></p>
<p>动态修改日志级别</p>
<ol>
<li>通过ognl获取对应类上的logger对象实现类</li>
<li>sc命令来查看具体从哪个jar包里加载的，sc -d org.apache.log4j.Logger</li>
<li>通过ognl修改日志级别</li>
</ol>
<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas13.png" alt="image"></p>
<p>更详细的介绍：<span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2FsaWJhYmEvYXJ0aGFzL2lzc3Vlcy8xMQ==">https://github.com/alibaba/arthas/issues/11<i class="fa fa-external-link-alt"></i></span></p>
<h2 id="dump"><a href="#dump" class="headerlink" title="dump"></a>dump</h2><p>将已加载类的字节码dump到本地磁盘上。</p>
<h2 id="jad"><a href="#jad" class="headerlink" title="jad"></a>jad</h2><p>有时我们经常会不确定线上或者测试环境的包是否是我们修改过的，这时候就可以通过jad反编译来看下。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">反编译指定已加载类的源码，jad demo.MathGame</span><br></pre></td></tr></table></figure>

<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas7.png" alt="image"></p>
<h2 id="classloader"><a href="#classloader" class="headerlink" title="classloader"></a>classloader</h2><p>将 JVM 中所有的classloader的信息统计出来，并可以展示继承树，urls等。</p>
<h2 id="redafine"><a href="#redafine" class="headerlink" title="redafine"></a>redafine</h2><p>该命令可以加载外部的.class文件，然后覆盖 jvm已加载的类。注意，这个命令不一定都能覆盖成功，如果添加了新的field，就不会加载成功。</p>
<p>关于redefine，arthas的github上有个非常经典的userCase：</p>
<p><span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2FsaWJhYmEvYXJ0aGFzL2lzc3Vlcy8yNjM=">https://github.com/alibaba/arthas/issues/263<i class="fa fa-external-link-alt"></i></span></p>
<p>动态更新代码，不用重启jvm</p>
<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas8.png" alt="image"></p>
<h2 id="watch"><a href="#watch" class="headerlink" title="watch"></a>watch</h2><ul>
<li>让你能方便的观察到指定方法的调用情况。能观察到的范围为：返回值、抛出异常、入参，通过编写 OGNL 表达式进行对应变量的查看。</li>
<li>watch的使用姿势比较丰富，可以在四个不同的场景观察方法的执行。比如方法调用之前、方法调用之后、方法异常之后、方法结束之后。默认观察的是方法结束之后。</li>
<li>如果观察的是方法结束之后的场景，由于入参可能在执行方法时被改变，所以此时输出的可能不是真正的入参。因此，要看真正的入参，要看方法调用之前的，也就是加上-b的参数。</li>
<li>另外，使用-b参数观察的话，则观察不到方法返回的结果以及抛出的异常了。</li>
</ul>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
</tr>
</thead>
<tbody><tr>
<td>class-pattern</td>
<td>类名表达式匹配</td>
</tr>
<tr>
<td>method-pattern</td>
<td>方法名表达式匹配</td>
</tr>
<tr>
<td>express</td>
<td>观察表达式</td>
</tr>
<tr>
<td>condition-express</td>
<td>条件表达式</td>
</tr>
<tr>
<td>[b]</td>
<td>在方法调用之前观察</td>
</tr>
<tr>
<td>[e]</td>
<td>在方法异常之后观察</td>
</tr>
<tr>
<td>[s]</td>
<td>在方法返回之后观察</td>
</tr>
<tr>
<td>[f]</td>
<td>在方法结束之后(正常返回和异常返回)观察</td>
</tr>
<tr>
<td>[E]</td>
<td>开启正则表达式匹配，默认为通配符匹配</td>
</tr>
<tr>
<td>[x:]</td>
<td>指定输出结果的属性遍历深度，默认为 1</td>
</tr>
<tr>
<td>[n:]</td>
<td>只执行n次，默认会不断输出，除非用户按下cltr+c</td>
</tr>
</tbody></table>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"># 观察CommonTest的test方法</span><br><span class="line"># 输出 入参、返回结果、抛出的异常 —— 输出的内容可以动态调整</span><br><span class="line"># 后面跟着的是 条件表达式，表示耗时超过10ms才输出</span><br><span class="line"># -n 表示只执行一次，-x表示 入参和返回结果的展开层次为5层</span><br><span class="line">watch *.CommonTest test &quot;&#123;params,returnObj,throwExp&#125;&quot; &#x27;#cost&gt;10&#x27; -x 5 -n 1</span><br><span class="line"></span><br><span class="line"># 耗时大于10ms并且第一个参数等于1才输出</span><br><span class="line">watch *.CommonTest test &quot;&#123;params,returnObj,throwExp&#125;&quot; &#x27;#cost&gt;10 &amp;&amp; params[0]==1&#x27; -x 5 -n 1</span><br><span class="line"># 第一个参数大于1 并且第二个参数等于hello才输出</span><br><span class="line">watch *.CommonTest test &quot;&#123;params,returnObj,throwExp&#125;&quot; &#x27;params[0]&gt;1 &amp;&amp; params[1]==&quot;hello&quot;&#x27; -x 5 -n 1</span><br><span class="line"># 第一个参数小于5或者第二个参数等于&quot;world&quot;就输出</span><br><span class="line">watch *.CommonTest test &quot;&#123;params,returnObj,throwExp&#125;&quot; &#x27;params[0]&lt;5 || params[1]==&quot;wolrd&quot;&#x27; -x 5 -n 1</span><br><span class="line"># 第一个参数的name字段等于world时才输出。</span><br><span class="line"># 由于在方法执行过程中参数的name属性可能发生改变，因此加上-b才能观察到真正的入参</span><br><span class="line">watch -b *.CommonTest test &quot;&#123;params,returnObj,throwExp&#125;&quot; &#x27;params[0].name==&quot;wolrd&quot;&#x27; -x 5 -n 1</span><br><span class="line"></span><br><span class="line"># 由于同时指定了-s和-b，所以方法被调用一次，就会输出2次结果(两个场景分开输出)，分别是方法被调用前，和返回之后</span><br><span class="line"># 注意，这里如果-n只设置成1，那么只会输出-b对应的输出,-s对应的输出由于没有次数了就无法输出了</span><br><span class="line">watch *.CommonTest test &#x27;&#123;params,returnObj,throwExp&#125;&#x27; -x 5 -n 2 -s -b</span><br></pre></td></tr></table></figure>

<p>在填写条件表达式时要注意一点，条件表达式中的params默认都是获取的方法执行完后的参数信息，比如入参a的属性name方法执行前是”hello”,在方法执行后变成了”world”,那么条件表达式传入’params[0].name=”hello”‘将不会输出，只有填入’params[0].name=”hello”‘才可以匹配上。这点对于后面的trace、stack命令也是一样的。</p>
<p>查看方法输入参数/返回值/异常信息，watch demo.MathGame primeFactors “{params,returnObj}” -x 2<br><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas9.png" alt="image"></p>
<h2 id="monitor"><a href="#monitor" class="headerlink" title="monitor"></a>monitor</h2><p>monitor命令可以监控方法的执行情况。比如调用成功次数，失败次数，失败率、平均执行时间等等。默认120秒输出一次，也就是说，当我们输入monitor命令之后，每120秒就会输出一次统计结果。</p>
<p>通过-c参数可以修改输出频率，支持通配符和正则表达式。<br>monitor -c 5 demo.MathGame primeFactors<br><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas10.png" alt="image"></p>
<h2 id="trace"><a href="#trace" class="headerlink" title="trace"></a>trace</h2><p>方法内部调用路径，并输出方法路径上的每个节点上耗时，tt命令会记录每次方法调用的各种信息。它和watch有些相似但是它能记录下各个时间点的调用信息，之后随时查看，甚至replay这次调用。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">trace demo.MathGame run</span><br></pre></td></tr></table></figure>

<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas11.png" alt="image"></p>
<h2 id="tt"><a href="#tt" class="headerlink" title="tt"></a>tt</h2><p>timetunnel,记录下指定方法每次调用的入参和返回信息，并能对这些不同的时间下调用进行观测,同时可回放该方法调用<br>tt -t demo.MathGame primeFactors</p>
<p><img src="/images/Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8/arthas12.png" alt="image"></p>
<p>直接重放请求参数</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">1.使用tt –t 类名次 方法名次</span><br><span class="line">2.tt –play -i 1000</span><br></pre></td></tr></table></figure>

<hr>
<p>另外介绍几个我经常用的工具，jmap,jstat,jstack,dump这些基本的就不介绍了。</p>
<h1 id="Tprofiler"><a href="#Tprofiler" class="headerlink" title="Tprofiler"></a>Tprofiler</h1><p>TProfiler是一个可以在生产环境长期使用的性能分析工具.它同时支持剖析和采样两种方式,记录方法执行的时间和次数,生成方法热点 对象创建热点 线程状态分析等数据,为查找系统性能瓶颈提供数据支持.</p>
<p>TProfiler在JVM启动时把时间采集程序注入到字节码中,整个过程无需修改应用源码.运行时会把数据写到日志文件,一般情况下每小时输出的日志小于50M.</p>
<h1 id="show-busy-java-threads"><a href="#show-busy-java-threads" class="headerlink" title="show-busy-java-threads"></a>show-busy-java-threads</h1><ul>
<li>查找cpu性能消耗过程<br>top命令找出消耗CPU高的Java进程及其线程id：<br>开启线程显示模式（top -H，或是打开top后按H）<br>按CPU使用率排序（top缺省是按CPU使用降序，已经合要求；打开top后按P可以显式指定按CPU使用降序）<br>记下Java进程id及其CPU高的线程id</li>
<li>查看消耗CPU高的线程栈：<br>用进程id作为参数，jstack出有问题的Java进程<br>手动转换线程id成十六进制（可以用printf %x 1234）<br>在jstack输出中查找十六进制的线程id（可以用vim的查找功能/0x1234，或是grep 0x1234 -A 20）</li>
<li>查看对应的线程栈，分析问题<br>查问题时，会要多次上面的操作以分析确定问题，这个过程太繁琐太慢了。</li>
<li>参考：<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTMzMzIxMjQvYXJ0aWNsZS9kZXRhaWxzLzg0ODg4MDc0IzExX3JlZGVmaW5lXzE1Nw==">https://blog.csdn.net/u013332124/article/details/84888074#11_redefine_157<i class="fa fa-external-link-alt"></i></span></li>
</ul>

    </div>

    
    
    
        <div class="reward-container">
  <div></div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/wechatpay.png" alt="云记 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/alipay.png" alt="云记 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>


      <footer class="post-footer">

        
  <div class="post-widgets">
    <div class="wp_rating">
      <div id="wpac-rating"></div>
    </div>
  </div>


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/08/18/Java%E6%9C%80%E5%85%A8%E9%9D%A2%E8%AF%95%E9%A2%98/" rel="prev" title="史上最全Java面试题(陆续更新中...)">
      <i class="fa fa-chevron-left"></i> 史上最全Java面试题(陆续更新中...)
    </a></div>
      <div class="post-nav-item">
    <a href="/2022/08/01/%E6%9C%80%E5%85%A8%E9%9D%A2%E8%AF%95%E7%AC%94%E8%AE%B0-%E9%99%84%E4%BB%A3%E7%A0%81%E7%85%A7%E7%9D%80%E8%AF%BB%E9%83%BD%E8%83%BD%E6%8B%BF%E9%AB%98%E8%96%AA/" rel="next" title="最全面试笔记-附代码照着读都能拿高薪">
      最全面试笔记-附代码照着读都能拿高薪 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#Arthas%E6%8E%92%E6%9F%A5jvm%E7%9B%B8%E5%85%B3%E9%97%AE%E9%A2%98%E7%9A%84%E5%88%A9%E5%99%A8"><span class="nav-number">1.</span> <span class="nav-text">Arthas排查jvm相关问题的利器</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E8%83%8C%E6%99%AF%EF%BC%9A"><span class="nav-number">2.</span> <span class="nav-text">背景：</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Arthas%E5%88%B0%E5%BA%95%E6%98%AF%E4%BB%80%E4%B9%88"><span class="nav-number">3.</span> <span class="nav-text">Arthas到底是什么</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Arthas%E8%BF%90%E8%A1%8C%E5%8E%9F%E7%90%86"><span class="nav-number">4.</span> <span class="nav-text">Arthas运行原理</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Arthas%E5%91%BD%E4%BB%A4%E5%88%97%E8%A1%A8"><span class="nav-number">5.</span> <span class="nav-text">Arthas命令列表</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#athas%E7%9A%84%E5%90%84%E4%B8%AA%E5%91%BD%E4%BB%A4"><span class="nav-number">6.</span> <span class="nav-text">athas的各个命令</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#sc-%E5%92%8C-sm"><span class="nav-number">6.1.</span> <span class="nav-text">sc 和 sm</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#dashboard"><span class="nav-number">6.2.</span> <span class="nav-text">dashboard</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#thread"><span class="nav-number">6.3.</span> <span class="nav-text">thread</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jvm"><span class="nav-number">6.4.</span> <span class="nav-text">jvm</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#getstatic"><span class="nav-number">6.5.</span> <span class="nav-text">getstatic</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#sysprop%E5%92%8Csysenv"><span class="nav-number">6.6.</span> <span class="nav-text">sysprop和sysenv</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#ognl"><span class="nav-number">6.7.</span> <span class="nav-text">ognl</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#dump"><span class="nav-number">6.8.</span> <span class="nav-text">dump</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jad"><span class="nav-number">6.9.</span> <span class="nav-text">jad</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#classloader"><span class="nav-number">6.10.</span> <span class="nav-text">classloader</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#redafine"><span class="nav-number">6.11.</span> <span class="nav-text">redafine</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#watch"><span class="nav-number">6.12.</span> <span class="nav-text">watch</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#monitor"><span class="nav-number">6.13.</span> <span class="nav-text">monitor</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#trace"><span class="nav-number">6.14.</span> <span class="nav-text">trace</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#tt"><span class="nav-number">6.15.</span> <span class="nav-text">tt</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#Tprofiler"><span class="nav-number">7.</span> <span class="nav-text">Tprofiler</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#show-busy-java-threads"><span class="nav-number">8.</span> <span class="nav-text">show-busy-java-threads</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">云记</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">12</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">5</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://gitee.com/feege" title="GitHub → https:&#x2F;&#x2F;gitee.com&#x2F;feege"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2023</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">云记</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">217k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">3:18</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>




  
  <script>
    (function(){
      var canonicalURL, curProtocol;
      //Get the <link> tag
      var x=document.getElementsByTagName("link");
		//Find the last canonical URL
		if(x.length > 0){
			for (i=0;i<x.length;i++){
				if(x[i].rel.toLowerCase() == 'canonical' && x[i].href){
					canonicalURL=x[i].href;
				}
			}
		}
    //Get protocol
	    if (!canonicalURL){
	    	curProtocol = window.location.protocol.split(':')[0];
	    }
	    else{
	    	curProtocol = canonicalURL.split(':')[0];
	    }
      //Get current URL if the canonical URL does not exist
	    if (!canonicalURL) canonicalURL = window.location.href;
	    //Assign script content. Replace current URL with the canonical URL
      !function(){var e=/([http|https]:\/\/[a-zA-Z0-9\_\.]+\.baidu\.com)/gi,r=canonicalURL,t=document.referrer;if(!e.test(r)){var n=(String(curProtocol).toLowerCase() === 'https')?"https://sp0.baidu.com/9_Q4simg2RQJ8t7jm9iCKT-xh_/s.gif":"//api.share.baidu.com/s.gif";t?(n+="?r="+encodeURIComponent(document.referrer),r&&(n+="&l="+r)):r&&(n+="?l="+r);var i=new Image;i.src=n}}(window);})();
  </script>



  <script>
  if (CONFIG.page.isPost) {
    wpac_init = window.wpac_init || [];
    wpac_init.push({
      widget: 'Rating',
      id    : ,
      el    : 'wpac-rating',
      color : 'fc6423'
    });
    (function() {
      if ('WIDGETPACK_LOADED' in window) return;
      WIDGETPACK_LOADED = true;
      var mc = document.createElement('script');
      mc.type = 'text/javascript';
      mc.async = true;
      mc.src = '//embed.widgetpack.com/widget.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mc, s.nextSibling);
    })();
  }
  </script>

  
<script src="/js/local-search.js"></script>











<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme    : 'forest',
      logLevel : 3,
      flowchart: { curve     : 'linear' },
      gantt    : { axisFormat: '%m/%d/%Y' },
      sequence : { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'QCF1KJ4ILmj73nVybNhgiHEJ-gzGzoHsz',
      appKey     : 'di34H8f5jhsb77nm4gtqtxQu',
      placeholder: "发表下你的看法!",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-cn' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
